package com.fas.system.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.logging.log4j.util.Strings;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * 微型消防站对象 fas_fire_engine
 */
@ApiModel(value = "微型消防站对象")
public class FasMiniatureStation implements Serializable {

    @ApiModelProperty(value = "主键")
    private Integer id;//主键

    @ApiModelProperty(value = "微型消防站名称")
    private String stationName;//微型消防站名称

    @ApiModelProperty(value = "所属单位")
    private Long deptId;//所属单位

    @ApiModelProperty(value = "经度")
    private Double longitude;//经度

    @ApiModelProperty(value = "纬度")
    private Double latitude;//纬度

    @ApiModelProperty(value = "省份编码")
    private String provinceCode;//省份编码

    @ApiModelProperty(value = "省份名")
    private String provinceName;//省份名

    @ApiModelProperty(value = "城市编码")
    private String cityCode;//城市编码

    @ApiModelProperty(value = "城市名称")
    private String cityName;//城市名称

    @ApiModelProperty(value = "区域（区县级）编码")
    private String areaCode;//区域（区县级）编码

    @ApiModelProperty(value = "区域（区县级）名称")
    private String areaName;//区域（区县级）名称

    @ApiModelProperty(value = "乡镇编码")
    private String wayCode;//乡镇编码

    @ApiModelProperty(value = "乡镇名称")
    private String wayName;//乡镇名称

    @ApiModelProperty(value = "值班电话")
    private String dutyPhone;//值班电话

    @ApiModelProperty(value = "微站类型（0：重点单位，1：社区微站）")
    private Integer miniatureStationType;//微站类型（0：重点单位，1：社区微站）

    @ApiModelProperty(value = "是否启用（0：未启用，1：启用）")
    private Integer enable;//是否启用（0：未启用，1：启用）

    @ApiModelProperty(value = "人员值守的用户id")
    @JsonIgnore
    private String userIds;//人员值守的用户id

    @ApiModelProperty(value = "水带（条）")
    private Integer waterBandNum;//水带（条）

    @ApiModelProperty(value = "水枪（只）")
    private Integer waterGunNum;//水枪（只）

    @ApiModelProperty(value = "灭火器")
    private Integer fireExtinguisherNum;//灭火器

    @ApiModelProperty(value = "防护服（件）")
    private Integer helmetNum;//防护服（件）

    @ApiModelProperty(value = "消防头盔（个）")
    private Integer protectionSuitNum;//消防头盔（个）

    @ApiModelProperty(value = "防护靴（双）")
    private Integer protectiveBootsNum;//防护靴（双）

    @ApiModelProperty(value = "破拆工具（套）")
    private Integer entryToolNum;//破拆工具（套）

    @ApiModelProperty(value = "微型消防车辆（辆）")
    private Integer fireEngineNum;//微型消防车辆（辆）

    @ApiModelProperty(value = "辖区支队")
    private String detachment;//辖区支队

    @ApiModelProperty(value = "辖区大队")
    private String battalion;//辖区大队

    @ApiModelProperty(value = "辖区中队")
    private String squadron;//辖区中队

    @ApiModelProperty(value = "站长")
    private String stationAgent;//站长

    @ApiModelProperty(value = "站长联系方式")
    private String agentPhone;//站长联系方式

    private Integer cooperationCompanyId; //合作单位id

    private String markAddress; //标记位置

    //非表字段
    private List<SysUserMiniatureStation> users;  // 维保单位下所有的人员

    private List<Long> userIdList;
    private String companyName; //合作单位名称
    private String deptName;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getWayCode() {
        return wayCode;
    }

    public void setWayCode(String wayCode) {
        this.wayCode = wayCode;
    }

    public String getWayName() {
        return wayName;
    }

    public void setWayName(String wayName) {
        this.wayName = wayName;
    }

    public String getDutyPhone() {
        return dutyPhone;
    }

    public void setDutyPhone(String dutyPhone) {
        this.dutyPhone = dutyPhone;
    }

    public Integer getMiniatureStationType() {
        return miniatureStationType;
    }

    public void setMiniatureStationType(Integer miniatureStationType) {
        this.miniatureStationType = miniatureStationType;
    }

    public Integer getEnable() {
        return enable;
    }

    public void setEnable(Integer enable) {
        this.enable = enable;
    }

    public String getUserIds() {
        return userIds;
    }

    public void setUserIds(String userIds) {
        this.userIds = userIds;
    }

    public Integer getWaterBandNum() {
        return waterBandNum;
    }

    public void setWaterBandNum(Integer waterBandNum) {
        this.waterBandNum = waterBandNum;
    }

    public Integer getWaterGunNum() {
        return waterGunNum;
    }

    public void setWaterGunNum(Integer waterGunNum) {
        this.waterGunNum = waterGunNum;
    }

    public Integer getFireExtinguisherNum() {
        return fireExtinguisherNum;
    }

    public void setFireExtinguisherNum(Integer fireExtinguisherNum) {
        this.fireExtinguisherNum = fireExtinguisherNum;
    }

    public Integer getHelmetNum() {
        return helmetNum;
    }

    public void setHelmetNum(Integer helmetNum) {
        this.helmetNum = helmetNum;
    }

    public Integer getProtectionSuitNum() {
        return protectionSuitNum;
    }

    public void setProtectionSuitNum(Integer protectionSuitNum) {
        this.protectionSuitNum = protectionSuitNum;
    }

    public Integer getProtectiveBootsNum() {
        return protectiveBootsNum;
    }

    public void setProtectiveBootsNum(Integer protectiveBootsNum) {
        this.protectiveBootsNum = protectiveBootsNum;
    }

    public Integer getEntryToolNum() {
        return entryToolNum;
    }

    public void setEntryToolNum(Integer entryToolNum) {
        this.entryToolNum = entryToolNum;
    }

    public Integer getFireEngineNum() {
        return fireEngineNum;
    }

    public void setFireEngineNum(Integer fireEngineNum) {
        this.fireEngineNum = fireEngineNum;
    }

    public String getDetachment() {
        return detachment;
    }

    public void setDetachment(String detachment) {
        this.detachment = detachment;
    }

    public String getBattalion() {
        return battalion;
    }

    public void setBattalion(String battalion) {
        this.battalion = battalion;
    }

    public String getSquadron() {
        return squadron;
    }

    public void setSquadron(String squadron) {
        this.squadron = squadron;
    }

    public String getStationAgent() {
        return stationAgent;
    }

    public void setStationAgent(String stationAgent) {
        this.stationAgent = stationAgent;
    }

    public String getAgentPhone() {
        return agentPhone;
    }

    public void setAgentPhone(String agentPhone) {
        this.agentPhone = agentPhone;
    }

    public List<SysUserMiniatureStation> getUsers() {
        return users;
    }

    public void setUsers(List<SysUserMiniatureStation> users) {
        this.users = users;
    }

    public List<Long> getUserIdList() {
        if (Strings.isNotEmpty(userIds)){
            return Arrays.stream(userIds.split(",")).map(Long::parseLong).collect(Collectors.toList());
        }
        return userIdList;
    }

    public void setUserIdList(List<Long> userIdList) {
        if (!Objects.isNull(userIdList)) {
            this.userIds = userIdList.stream().map(String::valueOf).collect(Collectors.joining(","));
        }
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Integer getCooperationCompanyId() {
        return cooperationCompanyId;
    }

    public void setCooperationCompanyId(Integer cooperationCompanyId) {
        this.cooperationCompanyId = cooperationCompanyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getMarkAddress() {
        return markAddress;
    }

    public void setMarkAddress(String markAddress) {
        this.markAddress = markAddress;
    }
}
